package com.hightrast.service.compareToData.stage.impl;

import com.hightrast.service.api.entity.RastProducts;
import com.hightrast.service.compareToData.stage.EntityComparator;

import java.util.Objects;

/**
 * 商品 比较策略实现
 */
public class RastProductComparator implements EntityComparator<RastProducts> {
    @Override
    public boolean areEqual(RastProducts newEntity, RastProducts oldEntity) {
        return Objects.equals(newEntity.getTitle(), oldEntity.getTitle()) &&
                Objects.equals(newEntity.getVendor(), oldEntity.getVendor()) &&
                Objects.equals(newEntity.getProductType(), oldEntity.getProductType()) &&
                Objects.equals(newEntity.getUpdatedAt(), oldEntity.getUpdatedAt()) &&
                Objects.equals(newEntity.getPublishedAt(), oldEntity.getPublishedAt()) &&
                Objects.equals(newEntity.getPublishedScope(), oldEntity.getPublishedScope()) &&
                Objects.equals(newEntity.getTags(), oldEntity.getTags()) &&
                Objects.equals(newEntity.getStatus(), oldEntity.getStatus())
                ;
    }
}